package com.itheima.date.jdk8DateDemo;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Period;

public class JDK8DateDemo8 {
    public static void main(String[] args) {
        LocalDate localDate1 = LocalDate.of(2020, 1, 1);
        LocalDate localDate2 = LocalDate.of(2048, 12, 12);
        Period between = Period.between(localDate1, localDate2);
        System.out.println(between);

        System.out.println(between.getYears());
        System.out.println(between.getMonths());
        System.out.println(between.getDays());

        System.out.println(between.toTotalMonths());
    }
}
